import React, { useEffect, useState } from "react";
import "../../../styles/Details.scss";
import { useLocation, useNavigate } from "react-router-dom";
interface Props {}
function Details(props: Props) {
  var location = useLocation();
  var navigate = useNavigate();
  var [data, setData]: any = useState([]);
  //获取详情数据
  useEffect(() => {
    setData(location.state);
  }, []);
  var back = () => {
    navigate("/index/home/deposit/depositList");
  };
  return (
    <div className="details">
      <div className="head">仓储管理 / 出库管理 / 出库详情</div>
      <div className="main">
        <div className="box">
          <div className="smallbox">
            出库单号:<span>{data.danhao}</span>
          </div>
          <div className="smallbox">
            出库人员:<span>{data.renyuan}</span>
          </div>
          <div className="smallbox">
            出库仓库:<span>{data.cangku}</span>
          </div>
          <div className="smallbox">
            申请出库单时间:<span>{data.time}</span>
          </div>
          <div className="smallbox">
            审核人:<span>{data.shenheren}</span>
          </div>
          <div className="smallbox">
            审核时间:<span>{data.shenhetime}</span>
          </div>
          <div className="smallbox">
            状态:<span>{data.zhuangtai}</span>
          </div>
        </div>
        <div className="btn">
          <button onClick={back}>返回</button>
        </div>
      </div>
    </div>
  );
}

export default Details;
